<template>
  <viewCard title="报考人数/录取人数">
    <div class="line-chart" ref="lineChart"></div>
  </viewCard>
</template>

<script>
import {option} from "@/charts/linecharts"
import api from '@/api/api'
export default {
  name: "LineChart",
  data() {
    return {}
  },
  mounted() {
    let myChart = this.$echarts.init(this.$refs.lineChart);
    option && myChart.setOption(option);
    this.getLineData()
  },
  methods: {
    getLineData() {
      console.log(api.getLineData())
      return api.getLineData().then(res => {
        console.log(res.data.typeAData)
        this.$store.commit("setLineData",res.data.typeAData)
      });
    }
  }
}
</script>

<style scoped>

</style>
